﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ApplicationObject : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
        if (Application["chat"]!= null)
        {
            TxtMainChat.Text = Application["chat"].ToString();
        }
    }
    protected void BtnGo_Click(object sender, EventArgs e)
    {
        Application["chat"] += TxtUserName.Text + " >> " + TxtText.Text+ Environment.NewLine;
        TxtMainChat.Text = Application["chat"].ToString();
        TxtText.Text = "";
        TxtText.Focus();
        
    }
    
    protected void BtnFlushChat_Click(object sender, EventArgs e)
    {
        TxtMainChat.Text = "";
        Application["chat"] = null;
    }
}
